Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

303
Visualizações
Rewrite Rules with [R=301] in .htaccess

I have decided to introduce folders into my URLs for SEO reasons. Now im trying to 301 all the old URLs.

The physical location of these 100+ pages is in the root:

www.mydomain.com/pageA1.php
www.mydomain.com/pageA2.php
www.mydomain.com/pageB1.php
www.mydomain.com/pageB2.php

I now want the URLs to include a folder name - but the physical location to stay the same:

www.mydomain.com/a-waste/pageA1.php
www.mydomain.com/a-waste/pageA2.php
www.mydomain.com/b-waste/pageB1.php
www.mydomain.com/b-waste/pageB2.php

My current rules are:

RewriteRule a-waste/pageA1.php /pageA1.php
RewriteRule a-waste/pageA2.php /pageA2.php
RewriteRule b-waste/pageB1.php /pageB1.php
RewriteRule b-waste/pageB2.php /pageB2.php

This works fine in the sense that if I browse www.mydomain.com/a-waste/pageA1.php - this URL stays in my address bar and it shows the page physically located www.mydomain.com/pageA1.php.

Now if I add [R=301,L] to this rule to tell google its permanent, it no longer rewrites the URL, it just redirects it instead? What am i missing?

thanks. Alex.

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda